API Documentation
Public Member Functions | List of all members
nkGraphics::CompositorManager Class Referencefinal

Manages the Compositor available in the component. More...

Inheritance diagram for nkGraphics::CompositorManager:

Public Member Functions

 CompositorManager ()
 
 ~CompositorManager ()
 
CompositorgetActiveCompositor () const
 
CompositorgetDefaultCompositor () const
 
CompositorcreateOrRetrieve (const nkMemory::StringView &name)
 
Compositorget (const nkMemory::StringView &name)
 
CompositorgetByIndex (unsigned int index)
 
void rename (const nkMemory::StringView &oldName, const nkMemory::StringView &newName)
 
void erase (const nkMemory::StringView &name)
 
void setActiveCompositor (Compositor *compositor)
 
void setDefaultCompositor (Compositor *compositor)
 
void prepareForContext (RenderContext *context)
 

Detailed Description

Manages the Compositor available in the component.

At all times, memory returned by the manager is owned by it. External code should never delete memory it retrieved from it.

Constructor & Destructor Documentation

◆ CompositorManager()

nkGraphics::CompositorManager::CompositorManager ( )

Constructor.

◆ ~CompositorManager()

nkGraphics::CompositorManager::~CompositorManager ( )

Destructor.

Member Function Documentation

◆ getActiveCompositor()

Compositor* nkGraphics::CompositorManager::getActiveCompositor ( ) const
Returns
The currently active compositor.

◆ getDefaultCompositor()

Compositor* nkGraphics::CompositorManager::getDefaultCompositor ( ) const
Returns
The currently set default compositor.

◆ createOrRetrieve()

Compositor* nkGraphics::CompositorManager::createOrRetrieve ( const nkMemory::StringView name)

Creates if unavailable, or retrieves if available, a compositor attached to given name.

Parameters
nameThe name of the compositor to retrieve.
Returns
A freshly created compositor, or an existing one. The manager owns returned data, external code should never delete it. See erase().

◆ get()

Compositor* nkGraphics::CompositorManager::get ( const nkMemory::StringView name)

Retrieves an existing compositor.

Parameters
nameThe name of the compositor to retrieve.
Returns
The compositor requested if existing, nullptr else.

◆ getByIndex()

Compositor* nkGraphics::CompositorManager::getByIndex ( unsigned int  index)

Retrieves a compositor by index. Keep in mind that as compositors are added / erased, the same index can return a different compositor. This function is useful when retrieving all existing compositors in one go.

Parameters
indexThe index from which to retrieve a compositor.
Returns
The compositor currently attached to the index if available, nullptr else.

◆ rename()

void nkGraphics::CompositorManager::rename ( const nkMemory::StringView oldName,
const nkMemory::StringView newName 
)

Renames a compositor.

Parameters
oldNameThe name currently used by the compositor.
newNameThe new name the compositor should get.

◆ erase()

void nkGraphics::CompositorManager::erase ( const nkMemory::StringView name)

Erases and frees memory used by a compositor.

Parameters
nameThe name of the compositor to erase.

◆ setActiveCompositor()

void nkGraphics::CompositorManager::setActiveCompositor ( Compositor compositor)

Sets the compositor currently active. This compositor will be the reference for given rendering iteration.

Parameters
compositorThe compositor to use.

◆ setDefaultCompositor()

void nkGraphics::CompositorManager::setDefaultCompositor ( Compositor compositor)

Sets the default compositor. This compositor will be the activated one when a context has no compositor attached.

Parameters
compositorThe compositor to use.

◆ prepareForContext()

void nkGraphics::CompositorManager::prepareForContext ( RenderContext context)

Prepares the rendering and sets as active the compositor tied to the context given. If none is set, the default compositor will be activated.

Parameters
contextThe context from which to activate a compositor.

The documentation for this class was generated from the following file: